#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e4 + 5;

int n, m, x, h;
int d[N];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> x >> h >> m;
  set<pii> st;
  while (m--) {
    int l, r;
    cin >> l >> r;
    if (l > r) swap(l, r);
    if (st.count(pii(l, r))) continue;
    st.insert(pii(l, r));
    d[l + 1]--;
    d[r]++;
  }
  d[0] = h;
  rep(i, 1, n) {
    d[i] += d[i - 1];
    cout << d[i] << endl;
  }
  return 0;
}